리팩토링 : XSS 공격 대비 및 불필요 코드 제거 #21
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
구현한 기능 중 마크다운 에디터 기능이 th:utext 타임리프 문법을 그대로 사용하기에, XSS 공격에 취약했습니다.
이를 해결하고자 common mark와 java-html-sanitizer를 같이 사용하였습니다.
commonmark에서는 일부 HTML 태그의 경우 extension 의존성을 주입해야 sanitizer에 적용 가능하여 각각 issue와 파일을 찾아가며 의존성 버전을 맞췄습니다.
개선 사항
src/main/resources/static/markdown.css
src/main/resources/templates/question/question_detail.html
** Answer / Question
Close #20